﻿using Sustainalytics.ClientDW.Synchronization.SyncESGData.CorporateDataLogic;
using Sustainalytics.ClientDW.Synchronization.SyncESGData.Tests.Helpers;
using Sustainalytics.Synchronization.Interface;
using System.Threading.Tasks;
using Xunit;

namespace Sustainalytics.ClientDW.Synchronization.SyncESGData.Tests
{
    public class ComprehensiveEsgQueriesTests
    {
        private readonly IComprehensiveEsgCompaniesIdsQuery comprehensiveEsgCompaniesIdsQuery;

        public ComprehensiveEsgQueriesTests()
        {
            ILogger logger = new TestLogger();

            var container = SimpleInjectorConfig.Register(logger, TestConnectionStrings.GAConnectionStrings);

            comprehensiveEsgCompaniesIdsQuery = container.GetInstance<EsgCompaniesIdsQuery>();
        }

        [Fact]
        public async Task GetEsgCompaniesIds()
        {
            var comprehensiveEsgCompaniesIds = await comprehensiveEsgCompaniesIdsQuery.GetAsync();
            Assert.NotEmpty(comprehensiveEsgCompaniesIds.CompaniesWithActiveResearch);
            Assert.NotEmpty(comprehensiveEsgCompaniesIds.InvalidatedCompanies);
        }
    }
}
